//
//  ImageLabel.m
//  Douban
//
//  Created by lanou3g on 15-3-6.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "ImageLabel.h"

@implementation ImageLabel

- (void)dealloc
{
    [_image_View release];
    [_nameLbl release];
    [_priceLbl release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
        
        CGFloat imageViewWidth = (frame.size.width-20)*0.3;
        CGFloat pHeight = frame.size.height-10;
        _image_View = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, imageViewWidth, pHeight)];
        
        [self addSubview:_image_View];
        
        CGFloat Width = frame.size.width - imageViewWidth - 10;
        _nameLbl = [[UILabel alloc] initWithFrame:CGRectMake(10+5+imageViewWidth, 5, Width, (pHeight-5)/2)];
        [self addSubview:_nameLbl];
        
        _priceLbl = [[UILabel alloc] initWithFrame:CGRectMake(10+5+imageViewWidth, 5 + 5 + (pHeight-5)/2, Width, (pHeight-5)/2)];
        _priceLbl.font = [UIFont systemFontOfSize:14];
        [self addSubview:_priceLbl];
    }
    return self;
}
@end
